<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">
<h:head>
	<title>Schola-Ratio</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<style type="text/css">
body {
	font-size: 12px;
}

.accordionMenu .ui-menu {
	width: 96% !important;
}

.accordionMenu .ui-accordion-content {
	padding: 0 !important;
	overflow: inherit !important;
}

.accordionMenu .ui-helper-clearfix:after {
	height: inherit !important;
}

.textSimple {
	font-weight: normal;
	color: #474747;
}
</style>
</h:head>
<h:body>

	<p:layout fullPage="true">
		<p:layoutUnit position="north">
			<p:toolbar style="overflow: hidden;">
				<p:toolbarGroup align="right">
					<form id="form_login" action="#{request.contextPath}/j_spring_security_logout" method="post">
						<h:outputLabel styleClass="textSimple" value="Olá #{request.userPrincipal.name} &nbsp;" />
						<button id="logoutButton"
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="submit">
							<span class="ui-button-text">Logout</span>
						</button>
					</form>
				</p:toolbarGroup>
				<p:toolbarGroup align="left">
					<a href="#{request.contextPath}/pages/index.schola"><img
						src="#{request.contextPath}/imagens/logo.png" height="80" /></a>
				</p:toolbarGroup>
			</p:toolbar>
		</p:layoutUnit>

		<p:layoutUnit position="west" size="250" collapsible="true" style="overflow: hidden;">
			<h:form>
				<p:growl id="messages" />
				<p:accordionPanel styleClass="accordionMenu">
					<sec:ifAllGranted roles="ROLE_ACA">
						<p:tab title="Academico">
							<p:menu>
								<p:menuitem url="/pages/academico/notas_e_faltas.schola" value="Notas e Faltas" />
								<p:menuitem url="/pages/academico/relatorios.schola" value="Boletim" />
							</p:menu>
						</p:tab>
					</sec:ifAllGranted>
					<sec:ifAllGranted roles="ROLE_ADM">
						<p:tab title="Administrativo">
							<p:menu>
								<p:menuitem url="/pages/administrativo/cursos.schola" value="Cursos" />
								<p:menuitem url="/pages/administrativo/disciplinas.schola" value="Disciplinas" />
								<p:menuitem url="/pages/administrativo/turmas.schola" value="Turmas" />
								<p:menuitem url="/pages/administrativo/matriculas.schola" value="Matriculas" />
							</p:menu>
						</p:tab>
					</sec:ifAllGranted>
					<sec:ifAllGranted roles="ROLE_FIN">
						<p:tab title="Financeiro">
							<p:menu>
								<p:menuitem url="/pages/financeiro/mensalidades.schola" value="Mensalidades" />
								<sec:ifAllGranted roles="ROLE_ADM">
									<p:menuitem url="/pages/financeiro/desconto.schola" value="Desconto" />
								</sec:ifAllGranted>
							</p:menu>
						</p:tab>
					</sec:ifAllGranted>
					<sec:ifAllGranted roles="ROLE_USR">
						<p:tab title="Usuarios">
							<p:menu>
								<p:menuitem url="/pages/usuarios/alunos.schola" value="Alunos" />
								<p:menuitem url="/pages/usuarios/professores.schola" value="Professores" />
								<p:menuitem url="/pages/usuarios/usuarios.schola" value="Usuários" />
							</p:menu>
						</p:tab>
					</sec:ifAllGranted>
					<sec:ifAllGranted roles="ROLE_CFG">
						<p:tab title="Configurações">
							<p:menu>
								<p:menuitem url="/pages/configuracoes/configuracoesDoSistema.schola" value="Dados da Instituição" />
								<p:menuitem url="/pages/configuracoes/confGeraisSistema.schola" value="Parametros do Sistema" />
							</p:menu>
						</p:tab>
					</sec:ifAllGranted>
				</p:accordionPanel>
			</h:form>
		</p:layoutUnit>

		<p:layoutUnit position="center">
			<ui:insert name="content"></ui:insert>
		</p:layoutUnit>

		<p:layoutUnit style="text-align: center; " position="south">
			<h:outputLabel style="overflow: hidden;" value="TCC - Facet 2012 - Djulles IKEDA e Osnir F CUNHA" />
		</p:layoutUnit>
	</p:layout>

</h:body>
</html>